<!DOCTYPE HTML>
<html>
<head>
<meta charset="utf-8">
<title>SmartMad Monitor</title>
<link rel="stylesheet" href="../assets/css/bootstrap-spacelab.css" />
<link rel="stylesheet" href="../assets/css/base.css?t=20130516173114" />

  <!-- template
    ================================================== -->
<script id="t_a" type="text/html">
	<ul>
		<% for (var i in json) {  %>
			<li><span><%= i %></span><a href="<%= json[i] %>">下载</a></li>
		<% } %> 
	</ul>
</script>

<style type="text/css">
li{padding:10px 0; border-bottom:dotted 1px #eee; font-size:14px;}
li a{float:right; margin-right:1em;}
</style>

</head>

<body>
    <header>
        <h1>文档和下载</h1>
        <div id="toolbar">
        	<div class="box_1">
 				<button class="btn" id="info"><i class="icon-info-sign"></i> 信息</button>
        	</div>
        </div> 
    </header>	

    <div id="mainbody">
    	<legend>文档</legend>
        <div id="docs">
        </div>
		<br />
		<legend>下载</legend>
        <div id="downloadList">
        </div>		
    </div>

  <!-- js part
    ================================================== -->
<script src="../assets/js/library/jquery-1.7.1.js"></script>
<script src="../assets/js/library/bootstrap.min.js"></script>
<script src="../assets/js/library/template.js"></script>
<script src="../assets/js/helper.js?t=20130516173114"></script>
<script src="../assets/js/doc.js?t=20130516173114"></script>		
<script>
$(function(){
	
    var smartMad = window.smartMad = window.smartMad || {};
	
    var getDocsConf = {
        url: smartMad._url + smartMad.api.getDocs
    };
	
	
    var getDocsCall = function(e, json){
    
        var $th = $(this), data, html;
        
        //$th.html(JSON.stringify(json));return;
        ///////////////////////////////////////////////
        
        data = {
            json: json
        };
        
        /////////////////////////////////////////////
        
        html = template('t_a', data);
        $th.html(html);
		
    };

	
    var getDownloadsConf = {
        url: smartMad._url + smartMad.api.getDownloads
    };	
	

    ///////////////////////////////////////////////////////////	
	//init
	///////////////////////////////////////////////////////////
    
    $('#docs').bind('ajax.success', getDocsCall).getData(getDocsConf);
	$('#downloadList').bind('ajax.success', getDocsCall).getData(getDownloadsConf);
	
});
</script>
</body>
</html>
